Skip to content

Adopt IBKR runtime target JSON wiring - #52

Merged
Pigbibi merged 10 commits into
mainfrom
codex/soxl-dynamic-rsi-deps
May 10, 2026
Merged

Adopt IBKR runtime target JSON wiring#52
Pigbibi merged 10 commits into
mainfrom
codex/soxl-dynamic-rsi-deps

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • carry the existing dynamic RSI dependency branch forward to latest main
  • require structured RUNTIME_TARGET_JSON for IBKR runtime settings and env sync
  • rename the account-group example to the paper account identity and pin QuantPlatformKit to the runtime-target JSON contract commit

Tests

  • PYTHONPATH=.:../QuantPlatformKit/src:../UsEquityStrategies/src .venv/bin/python -m pytest tests/test_runtime_config_support.py tests/test_notifications.py -q
  • bash tests/test_sync_cloud_run_env_workflow.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 317b22b426

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +82 to +88
raw_runtime_target = os.environ.get("RUNTIME_TARGET_JSON", "").strip()
if not raw_runtime_target:
raise SystemExit("RUNTIME_TARGET_JSON is required")
runtime_target = json.loads(raw_runtime_target)
profile = str(runtime_target.get("strategy_profile") or "").strip().lower()
if not profile:
raise SystemExit("STRATEGY_PROFILE is required")
raise SystemExit("RUNTIME_TARGET_JSON.strategy_profile is required")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate full runtime target contract before syncing env

The workflow now forwards RUNTIME_TARGET_JSON to Cloud Run, but this step only validates strategy_profile and never checks required fields like platform_id and dry_run_only (or execution_mode consistency). The runtime loader now enforces those fields via resolve_runtime_target_from_env, so an incomplete JSON (for example, one containing only strategy_profile) will pass CI here and then fail service startup after env sync, causing a broken revision in production.

Useful? React with 👍 / 👎.

Comment thread runtime_config_support.py
Comment on lines +87 to 90
runtime_target = resolve_runtime_target_from_env(env=os.environ, expected_platform_id=IBKR_PLATFORM)
strategy_definition = resolve_strategy_definition(
os.getenv("STRATEGY_PROFILE"),
runtime_target.strategy_profile,
platform_id=IBKR_PLATFORM,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep dry-run source consistent with runtime target JSON

This change makes RUNTIME_TARGET_JSON mandatory and uses it to choose the strategy profile, but it does not reconcile runtime_target.dry_run_only with the actual execution setting (still read from IBKR_DRY_RUN_ONLY). That creates a split-brain configuration where the target says paper/dry-run while execution can still run live if the env var is unset or different, which is a high-risk behavior mismatch introduced by the new wiring.

Useful? React with 👍 / 👎.

@Pigbibi
Pigbibi merged commit 3dae275 into main May 10, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/soxl-dynamic-rsi-deps branch May 10, 2026 07:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 109d4f2061

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +95 to +97
return self.reporting_builder(
runtime_assembly=runtime_assembly,
strategy_domain=self.strategy_domain,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass reporting context fields through composer

After this refactor, build_reporting_adapters() only passes runtime_assembly and no longer forwards extra_context_fields to build_runtime_reporting_adapters. The reporting adapter still builds summary.account_ids from self.extra_context_fields (application/runtime_reporting_adapters.py), so production reports generated via this composer will now emit empty account_ids even when account IDs are configured, reducing execution traceability and report accuracy.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant